
//  定义函数( 定义函数、定义对象、定义构造函数 )
// 用 "函数表达式方式"(function-expression) 定义函数
let Hello = function (){
    console.log('testing');
}

// let Hello = new Function( 'console.log('testing');' );

// 作普通函数调用
let x = Hello();
console.log( x ); // undefined

console.log( '- - - - - - - - - - - - - - -' );

// 作构造函数使用
let y = new Hello();
console.log( y );

console.log( '- - - - - - - - - - - - - - -' );

console.log( Hello ); // [Function: Hello]

console.log( '- - - - - - - - - - - - - - -' );

// let World = function( a , b ) { return a + b } ;
// 使用 Function类 的构造函数创建一个 Function实例
let World = new Function( 'a' , 'b' , 'return a + b ;');
console.log( World ); // [Function: anonymous]
console.log( World.toString() );

// let Welcome = function( name ) { console.log("欢迎" + name); }
let Welcome = new Function( 'name' , 'console.log("欢迎" + name)' );
console.log( Welcome ); // [Function: anonymous]
console.log( Welcome.toString() );

// 基础对象
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects#fundamental_objects
// https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects#fundamental_objects

// Function
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function
// https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Function